package com.iot.device.service.impl;

import java.util.List;
import com.iot.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.iot.device.mapper.QuakeEventOriginMapper;
import com.iot.device.domain.QuakeEventOrigin;
import com.iot.device.service.IQuakeEventOriginService;

/**
 * 事件源数据Service业务层处理
 * 
 * @author iot
 * @date 2023-04-14
 */
@Service
public class QuakeEventOriginServiceImpl implements IQuakeEventOriginService 
{
    @Autowired
    private QuakeEventOriginMapper quakeEventOriginMapper;

    /**
     * 查询事件源数据
     * 
     * @param id 事件源数据主键
     * @return 事件源数据
     */
    @Override
    public QuakeEventOrigin selectQuakeEventOriginById(Long id)
    {
        return quakeEventOriginMapper.selectQuakeEventOriginById(id);
    }

    /**
     * 查询事件源数据列表
     * 
     * @param quakeEventOrigin 事件源数据
     * @return 事件源数据
     */
    @Override
    public List<QuakeEventOrigin> selectQuakeEventOriginList(QuakeEventOrigin quakeEventOrigin)
    {
        return quakeEventOriginMapper.selectQuakeEventOriginList(quakeEventOrigin);
    }

    /**
     * 新增事件源数据
     * 
     * @param quakeEventOrigin 事件源数据
     * @return 结果
     */
    @Override
    public int insertQuakeEventOrigin(QuakeEventOrigin quakeEventOrigin)
    {
        quakeEventOrigin.setCreateTime(DateUtils.getNowDate());
        return quakeEventOriginMapper.insertQuakeEventOrigin(quakeEventOrigin);
    }

    /**
     * 修改事件源数据
     * 
     * @param quakeEventOrigin 事件源数据
     * @return 结果
     */
    @Override
    public int updateQuakeEventOrigin(QuakeEventOrigin quakeEventOrigin)
    {
        return quakeEventOriginMapper.updateQuakeEventOrigin(quakeEventOrigin);
    }

    /**
     * 批量删除事件源数据
     * 
     * @param ids 需要删除的事件源数据主键
     * @return 结果
     */
    @Override
    public int deleteQuakeEventOriginByIds(Long[] ids)
    {
        return quakeEventOriginMapper.deleteQuakeEventOriginByIds(ids);
    }

    /**
     * 删除事件源数据信息
     * 
     * @param id 事件源数据主键
     * @return 结果
     */
    @Override
    public int deleteQuakeEventOriginById(Long id)
    {
        return quakeEventOriginMapper.deleteQuakeEventOriginById(id);
    }
}
